<?php

class Router_Route_Abstract
{

	protected $_check = '';

	protected $_build = '';

	protected $_map = '';

	protected $_defs = array();

	protected $_reqs = array();

	public function __construct($params)
	{
		$this -> _check = $params['check'];
		$this -> _build = $params['build'];
		$this -> _defs = $params['defs'];
		$this -> _reqs = $params['reqs'];
		$this -> _map = $params['map'];
	}

	public function mapActionId($vals)
	{
		return str_replace(array_map('router_map_key', array_keys($vals)), array_values($vals), $this -> _map);
	}

}

function router_map_key($name)
{
	return '[' . $name . ']';
}
